// pages/user/collection/collection.js
import { urlEncode } from '../../../utils/util.js'
import { Target, HttpUtil } from '../../../utils/http_util.js'
var config = require('../../../utils/config.js')
var utils = require('../../../utils/util.js')
Page({

  /**
   * 页面的初始数据
   */
  data: {
    imgUrlBase: config.ictx,
    datalist:[]

  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
    var that = this;
    HttpUtil.get(Target.self, "/consumerCollection/search/"+options.userId, {}).then(res => {
      that.setData({
        datalist: res.data
      });
    })
  },
  goDtail: function (event) {
    var id = event.currentTarget.dataset.id;
    wx.navigateTo({
      url: '/pages/index/detail/detail?id=' + id,
    })
  }


})